package org.fing.edu.uy.esbadp.modules.persistance;

import java.io.IOException;
import java.sql.SQLException;
import java.util.List;

import org.fing.edu.uy.esbadp.core.entity.DMRegisteredService;
import org.fing.edu.uy.esbadp.core.entity.KeyValuePair;
import org.fing.edu.uy.esbadp.core.entity.MetaDataConfig;



/**
 * 
 * @author dev
 * Define la interfaz de acceso a las propiedades de los servicios registrados
 */
public interface ServiceManagerInterface {

	public int persistVirtualService(DMRegisteredService virtualService) throws SQLException;
	
	public void persistVirtualServiceMetadata(MetaDataConfig meta , long serviceID) throws SQLException;
	
    public List<DMRegisteredService> getAllVirtualServices() throws SQLException;
    
    public void persistEquivVirtualServices(List<DMRegisteredService> equiv, long serviceID) throws SQLException;
    
    public List<DMRegisteredService> getAllEquivVirtualServices(long serviceID) throws SQLException;
	
	public DMRegisteredService getVirtualService(String endpointUrl) throws SQLException;
	
	public DMRegisteredService getVirtualService(long serviceID) throws SQLException;
	
	public List<DMRegisteredService> getEquivalentVirtualServices(long serviceID) throws SQLException;
	
	public MetaDataConfig getVirtualServiceMetadata(long serviceID) throws SQLException;
	
	public int deleteVirtualServiceMetadata(String metaKey , long serviceID) throws SQLException;
	
	public int deleteVirtualService(long serviceID) throws SQLException;
	
	public int updateService(DMRegisteredService virtualService) throws SQLException;
	
	public int updateMetadata(KeyValuePair meta, long serviceID) throws SQLException;

	public int deleteEquivRelation(long serviceID) throws SQLException;
	
	public void saveToCanonicalXSL(String xsl, Long serviceID) throws IOException;
	
	public void saveFromCanonicalXSL(String xsl, Long serviceID) throws IOException;
	
	public String getToCanonicalXSL(Long serviceID) throws IOException;
	
	public String getFromCanonicalXSL(Long serviceID) throws IOException;

	Boolean hasCanonicalXSL(Long serviceID) throws IOException;
	
}
